require 'mathn'
puts 'A = '
A = gets.chomp.to_i
list_primes = Prime.new
list_primes.each { |prime| print prime, " "; break unless prime < A }